package com.gitee.zw.irmp.common.audit;

import jakarta.persistence.EntityListeners;
import jakarta.persistence.MappedSuperclass;
import jakarta.persistence.Version;
import lombok.Data;
import org.springframework.data.jpa.domain.support.AuditingEntityListener;

/**
 * 支持自动审计字段，同时支持乐观锁
 * @author WeiYZZhou
 */
@Data
@MappedSuperclass
@EntityListeners(AuditingEntityListener.class)
public abstract class VersionAuditable extends Auditable {


    @Version
    private Integer verNo;
}
